<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui"
	template="/template/template_layout_55_lr.xhtml"
	xmlns:s="http://sduept.security.el/func">
	<ui:define name="head">
		<link rel="stylesheet"
			href="/resources/plugins/datatables/dataTables.bootstrap.css" />
		<style>
			a:visited{color:black;}
			a:hover{ color:black;}
			a:link{ color:blue;}
			a:active{ color:green;}
		
		</style>
 		<script type="text/javascript" src="/resources/js/stringUtil.js"></script> 
		<script>		
			 function setText() {
					var out = document.getElementById("ldocsearch:out").innerHTML;
					var str = escape2Html(out);
					$("#info").html(str);
			}
			 function setMoreText() {
					var out = document.getElementById("ldocsearch:out1").innerHTML;
					var str = escape2Html(out);
					$("#info1").html(str);
			}
			function getMoreInfo(linenum,docName){
				getMoreInfoFromServer([{name:"lineNum",value:linenum},{name:"docName",value:docName}]);
			}
			
		</script>

	</ui:define>
	<ui:define name="left-box-tools">
		<h:form id="tdocsearch">
		 	<p:remoteCommand name="getMoreInfoFromServer" update=":ldocsearch:out1" oncomplete="setMoreText()"
			actionListener="#{documentSearchController.loadMoreInfo()}" />		
			<p:growl id="message" showDetail="true" />			
			<p:toolbar >
				<f:facet name="left">
					<p:autoComplete  scrollHeight="400" value="#{documentSearchController.keyword}" dropdown="true" size="40" completeMethod="#{documentSearchController.completeKeyWord}" placeholder="请输入关键字，多关键字请用空格分隔"></p:autoComplete>
					<p:commandButton style="margin-left:60px;" icon="ui-icon-search" value="检索一下"  oncomplete="setText();setMoreText();"
					actionListener="#{documentSearchController.totalKeyWord()}"  update=":tdocsearch:message :ldocsearch:out :ldocsearch:out1"></p:commandButton>
				</f:facet>
			</p:toolbar>
		</h:form>
	</ui:define>
	
	<ui:define name="left-box-body">
		<h:form id="ldocsearch">		
			<div id="info">
			</div>
			<p:outputPanel id="out"  style="display:none;">
				#{documentSearchController.info}
           	</p:outputPanel>		
			<p:outputPanel id="out1"  style="display:none;">
				#{documentSearchController.moreInfo}
           	</p:outputPanel>            	
       	</h:form>	
    </ui:define>
     <ui:define name="right-box-tools">
     	<h:form id="rdocsearchbtn">
           	<p:toolbar>
				<f:facet name="left">
					<p:commandButton value="向前加载" icon="ui-icon-seek-prev"  process="@this" oncomplete="setMoreText()" update=":ldocsearch:out1" actionListener="#{documentSearchController.loadPreInfo()}"></p:commandButton>
					<p:commandButton value="向后加载" icon="ui-icon-seek-next"  process="@this" oncomplete="setMoreText()" update=":ldocsearch:out1" actionListener="#{documentSearchController.loadAftInfo()}"></p:commandButton>
				</f:facet>
			</p:toolbar>
			</h:form>
     </ui:define>  
      <ui:define name="right-box-body"> 	
       	<h:form id="rdocsearch">	    	
           	<div id="info1">
			</div>
	   </h:form>
	</ui:define>


</ui:composition>
